/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui.controllers;

import bl.controllers.UserJpaController;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
import entities.User;

/**
 *
 * @author Spyros
 */
public class RegistrationController {
    
    private UserJpaController userJpaController;

    public BeanItem getUserDataSource() {
        return new BeanItem(new User());
    }

    public void register(Item userItem) {
        userJpaController = new UserJpaController();
        User user = (User) ((BeanItem) userItem).getBean();
        userJpaController.create(user);
    }
}
